/*
============================================================================
Name        : LuaUIView.cpp
Author      : Jian
Version     :
Copyright   : Jian
Description : Application view
============================================================================
*/

// INCLUDE FILES
#include <coemain.h>
#include "LuaUIAppView.h"

// ============================ MEMBER FUNCTIONS ===============================

// -----------------------------------------------------------------------------
// CLuaUIAppView::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CLuaUIAppView* CLuaUIAppView::NewL( const TRect& aRect )
{
    CLuaUIAppView* self = CLuaUIAppView::NewLC( aRect );
    CleanupStack::Pop( self );
    return self;
}

// -----------------------------------------------------------------------------
// CLuaUIAppView::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CLuaUIAppView* CLuaUIAppView::NewLC( const TRect& aRect )
{
    CLuaUIAppView* self = new ( ELeave ) CLuaUIAppView;
    CleanupStack::PushL( self );
    self->ConstructL( aRect );
    return self;
}

// -----------------------------------------------------------------------------
// CLuaUIAppView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CLuaUIAppView::ConstructL( const TRect& aRect )
{
    // Create a window for this application view
    CreateWindowL();

    // Set the windows size
    SetRect( aRect );

    // Activate the window, which makes it ready to be drawn
    ActivateL();
}

// -----------------------------------------------------------------------------
// CLuaUIAppView::CLuaUIAppView()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CLuaUIAppView::CLuaUIAppView()
{
    // No implementation required
}


// -----------------------------------------------------------------------------
// CLuaUIAppView::~CLuaUIAppView()
// Destructor.
// -----------------------------------------------------------------------------
//
CLuaUIAppView::~CLuaUIAppView()
{
    // No implementation required
}


// -----------------------------------------------------------------------------
// CLuaUIAppView::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CLuaUIAppView::Draw( const TRect& /*aRect*/ ) const
{
    // Get the standard graphics context
    CWindowGc& gc = SystemGc();

    // Gets the control's extent
    TRect drawRect( Rect());

    // Clears the screen
    gc.Clear( drawRect );

}

// -----------------------------------------------------------------------------
// CLuaUIAppView::SizeChanged()
// Called by framework when the view size is changed.
// -----------------------------------------------------------------------------
//
void CLuaUIAppView::SizeChanged()
{  
    DrawNow();
}
// End of File
